//
//  NineViewCell.m
//  UI_豆瓣
//
//  Created by dllo on 15/11/4.
//  Copyright © 2015年 蓝鸥科技. All rights reserved.
//

#import "NineViewCell.h"
#import "UIImageView+WebCache.h"
@implementation NineViewCell

- (void)dealloc
{
    [_nameLabel release];
    [_headImageView release];
    [super dealloc];
}

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        [self createCell];
    }
    return self;
}

-(void)createCell
{
    
    self.headImageView = [[UIImageView alloc]initWithFrame:self.contentView.bounds];
    self.headImageView.backgroundColor = [UIColor cyanColor];
    [self addSubview:self.headImageView];
    [_headImageView release];
    
    
    self.nameLabel = [[UILabel alloc]initWithFrame:CGRectMake(0, self.contentView.frame.size.height - 20, self.contentView.frame.size.width, 20)];
    self.nameLabel.backgroundColor = [UIColor whiteColor];
    [self addSubview:self.nameLabel];
    [_nameLabel release];
    
}

-(void)setMyMovie:(Movie *)myMovie
{
    if (_myMovie != myMovie) {
        [_myMovie release];
        _myMovie = [myMovie retain];
    }
    self.nameLabel.text = self.myMovie.movieName;
    
    NSURL *url = [NSURL URLWithString:self.myMovie.pic_url];
    
    [self.headImageView sd_setImageWithURL:url placeholderImage:[UIImage imageNamed:@"Movie111.png"]];
    
}



@end
